package org.method;

public class MethodDemo2 {
    public static void main(String[] args) {
//        判断两个int类型数组是否一样
        int[] arr1 = {11,22,33};
        int[] arr2 = {11,22,33};
        boolean result = equals(arr1,arr2);
        System.out.println(result==true?"相等":"不相等");
    }
    public static boolean equals(int[] arr1,int[] arr2){
        if(arr1 == null && arr2 == null){
            return true;
        }
        if(arr1 == null ||arr2 == null){
            return false;
        }
        if(arr1.length != arr2.length){
            return false;
        }
        for (int i = 0; i < arr1.length; i++) {
            if(arr1[i]!=arr2[i]){
                return false;
            }
        }
        return true;

    }
}
